package com.yanqu.road.entity.activity.toyhouse;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.utils.property.Property;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_toy_house_user")
public class ToyHouseUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", update = true, select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家ID", update = true, select = true)
    private long userId;

    @FieldTypeAnnotation(desc = "积分")
    private long score;
    @FieldTypeAnnotation(desc = "糖果子，成就道具数量")
    private long candyCount;

    @FieldTypeAnnotation(desc = "体力")
    private int energy;
    @FieldTypeAnnotation(desc = "体力恢复时间")
    private long recoveryTime;

    @FieldTypeAnnotation(desc = "新手引导下标")
    private int guideIndex;

    @FieldTypeAnnotation(desc = "盘面")
    private Map<Integer, ToyHouseBlockData> blockDataMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "订单")
    private Map<Integer, ToyHouseOrder> orderMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "玩具")
    private Property toyProp = new Property();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }

    public long getCandyCount() {
        return candyCount;
    }

    public void setCandyCount(long candyCount) {
        if (this.candyCount != candyCount) {
            this.candyCount = candyCount;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if (this.energy != energy) {
            this.energy = energy;
            setOp(DataStatus.Update);
        }
    }

    public long getRecoveryTime() {
        return recoveryTime;
    }

    public void setRecoveryTime(long recoveryTime) {
        if (this.recoveryTime != recoveryTime) {
            this.recoveryTime = recoveryTime;
            setOp(DataStatus.Update);
        }
    }

    public int getGuideIndex() {
        return guideIndex;
    }

    public void setGuideIndex(int guideIndex) {
        if (this.guideIndex != guideIndex) {
            this.guideIndex = guideIndex;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.toyhouse.ToyHouseBlockData> getBlockDataMap() {
        return blockDataMap;
    }

    public void setBlockDataMap(java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.toyhouse.ToyHouseBlockData> blockDataMap) {
        if (null == blockDataMap) {
            return;
        }
        this.blockDataMap = blockDataMap;
        setOp(DataStatus.Update);
    }

    public java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.toyhouse.ToyHouseOrder> getOrderMap() {
        return orderMap;
    }

    public void setOrderMap(java.util.Map<java.lang.Integer, com.yanqu.road.entity.activity.toyhouse.ToyHouseOrder> orderMap) {
        if (null == orderMap) {
            return;
        }
        this.orderMap = orderMap;
        setOp(DataStatus.Update);
    }

    public Property getToyProp() {
        return toyProp;
    }

    public void setToyProp(Property toyProp) {
        if (null == toyProp) {
            return;
        }
        this.toyProp = toyProp;
        setOp(DataStatus.Update);
    }

    // ============ 不入库 ============

    private long lastTipsTime = 0L;

    public long getLastTipsTime() {
        return lastTipsTime;
    }

    public void setLastTipsTime(long lastTipsTime) {
        this.lastTipsTime = lastTipsTime;
    }
}
